package com.example.yyjc.mapper;

import com.example.yyjc.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

/**
 * @ClassName UserMapper
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-11-10 9:49
 **/
@Mapper
public interface UserMapper {

    /**
     * 判断用户名是否重复
     * @param loginName
     * @return
     */
    public User verifyLoginName(String loginName);

    /**
     * 判断电话是否重复
     * @param phone
     * @return
     */
    public User verifyPhone(String phone);

    /**
     * 修改用户信息
     * @param user
     * @return
     */
    public boolean updateUser(User user);

    /**
     * 添加用户
     * @param user
     * @return
     */
    public boolean insertUser(User user);

    /**
     * 根据登录名获取用户
     * @param loginName
     * @return
     */
    public User getUserByLoginName(String loginName);

    /**
     * 修改密码
     * @param password
     * @param phone
     * @return
     */
    public User updatePassword(@Param("phone")String phone,@Param("password")String password);

    /**
     * 游客登录插入一条游客信息
     * @param user
     * @return
     */
    public boolean insertTourists(User user);

    /**
     * 查询所有用户信息
     * @param user
     * @return
     */
    public List<User> getAllUser(User user);

    /**
     * 导出用户信息
     * @param data
     * @return
     */
    public List<User> importUser(@Param("data") String data);
}
